{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CNTK 104: Time Series Basics with Pandas and Finance Data\n",
    "\n",
    "Contributed by: Avi Thaker\n",
    "November 20, 2016\n",
    "\n",
    "This tutorial will introduce the use of the Cognitive Toolkit for time series data. We show how to prepare time series data for deep learning algorithms. We will cover training a neural network and evaluating the neural network model. We will also look at the predictive potential on classification of an Exchange-traded Funds ([ETF](https://en.wikipedia.org/wiki/Exchange-traded_fund)), and in this simplified setting how one could trade it. This tutorial serves **only** as an example of how to use neural networks for time series analysis. \n",
    "    \n",
    "It is important to note that the stock market is extremely noisy and is difficult to predict. This is best done by professionals with domain expertise. It is more important to make sure the model is correct before setting up a trading system (there are many factors to consider including but not limited to: [curve fitting bias](https://en.wikipedia.org/wiki/Overfitting), [forward looking bias](http://www.investopedia.com/terms/l/lookaheadbias.asp?lgl=no-infinite), profitability etc.). The learnings and anecdotes presented in this tutorial is only for exemplary purposes with the goal of introducing an approach to analyze time series data.\n",
    "\n",
    "This tutorial introduces how to use pandas_datareader package and pandas. Please note, this tutorial will utilize the numpy interface to CNTK which interfaces well with [Pandas dataframes](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html) (a structure that is well suited towards timeseries analysis). \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from __future__ import print_function\n",
    "import datetime\n",
    "import numpy as np\n",
    "import os\n",
    "import pandas as pd\n",
    "pd.options.mode.chained_assignment = None  # default='warn'\n",
    "\n",
    "import cntk as C\n",
    "import cntk.tests.test_utils\n",
    "cntk.tests.test_utils.set_device_from_pytest_env() # (only needed for our build system)\n",
    "C.cntk_py.set_fixed_random_seed(1) # fix a random seed for CNTK components\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Read data\n",
    "We first retrieve stock data using the method `get_stock_data`. This method downloads stock data on a daily timescale from Google Finance (can be modified to get data from Yahoo Finance and many other sources). [Pandas datareader]( http://pandas-datareader.readthedocs.io/en/latest/remote_data.html) shows many use cases for the data reader."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# A method which obtains stock data from Google finance\n",
    "# Requires an Internet connection to retrieve stock data from Google finance\n",
    "\n",
    "import time\n",
    "try:\n",
    "    from  pandas_datareader import data\n",
    "except ImportError:\n",
    "    !pip install pandas_datareader\n",
    "    from  pandas_datareader import data \n",
    "    \n",
    "# Set a random seed\n",
    "np.random.seed(123)\n",
    "\n",
    "def get_stock_data(contract, s_year, s_month, s_day, e_year, e_month, e_day):\n",
    "    \"\"\"\n",
    "    Args:\n",
    "        contract (str): the name of the stock/etf\n",
    "        s_year (int): start year for data\n",
    "        s_month (int): start month\n",
    "        s_day (int): start day\n",
    "        e_year (int): end year\n",
    "        e_month (int): end month\n",
    "        e_day (int): end day\n",
    "    Returns:\n",
    "        Pandas Dataframe: Daily OHLCV bars\n",
    "    \"\"\"\n",
    "    start = datetime.datetime(s_year, s_month, s_day)\n",
    "    end = datetime.datetime(e_year, e_month, e_day)\n",
    "    \n",
    "    retry_cnt, max_num_retry = 0, 3\n",
    "    \n",
    "    while(retry_cnt < max_num_retry):\n",
    "        try:\n",
    "            bars = data.DataReader(contract,\"google\", start, end)\n",
    "            return bars\n",
    "        except:\n",
    "            retry_cnt += 1\n",
    "            time.sleep(np.random.randint(1,10)) \n",
    "            \n",
    "    print(\"Google Finance is not reachable\")\n",
    "    raise Exception('Google Finance is not reachable')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "File already exists data\\Stock\\stock_SPY.pkl\n"
     ]
    }
   ],
   "source": [
    "import pickle as  pkl\n",
    "\n",
    "# We search in cached stock data set with symbol SPY.               \n",
    "# Check for an environment variable defined in CNTK's test infrastructure\n",
    "envvar = 'CNTK_EXTERNAL_TESTDATA_SOURCE_DIRECTORY'\n",
    "def is_test(): return envvar in os.environ\n",
    "\n",
    "def download(data_file):\n",
    "    try:\n",
    "        data = get_stock_data(\"SPY\", 2000, 1,2,2017,1,1)\n",
    "    except:\n",
    "        raise Exception(\"Data could not be downloaded\")\n",
    "        \n",
    "    dir = os.path.dirname(data_file)\n",
    "        \n",
    "    if not os.path.exists(dir):\n",
    "        os.makedirs(dir)\n",
    "        \n",
    "    if not os.path.isfile(data_file):\n",
    "        print(\"Saving\", data_file )\n",
    "        with open(data_file, 'wb') as f:\n",
    "            pkl.dump(data, f, protocol = 2)\n",
    "    return data\n",
    "\n",
    "data_file = os.path.join(\"data\", \"Stock\", \"stock_SPY.pkl\")\n",
    "\n",
    "# Check for data in local cache\n",
    "if os.path.exists(data_file):\n",
    "        print(\"File already exists\", data_file)\n",
    "        data = pd.read_pickle(data_file) \n",
    "else: \n",
    "    # If not there we might be running in CNTK's test infrastructure\n",
    "    if is_test():\n",
    "        test_file = os.path.join(os.environ[envvar], 'Tutorials','data','stock','stock_SPY.pkl')\n",
    "        if os.path.isfile(test_file):\n",
    "            print(\"Reading data from test data directory\")\n",
    "            data = pd.read_pickle(test_file)\n",
    "        else:\n",
    "            print(\"Test data directory missing file\", test_file)\n",
    "            print(\"Downloading data from Google Finance\")\n",
    "            data = download(data_file)         \n",
    "    else:\n",
    "        # Local cache is not present and not test env\n",
    "        # download the data from Google finance and cache it in a local directory\n",
    "        # Please check if there is trade data for the chosen stock symbol during this period\n",
    "        data = download(data_file)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Build features\n",
    "\n",
    "The stock market behavior exhibits substantial [autocorrelation](https://en.wikipedia.org/wiki/Autocorrelation) ([reference](http://epchan.blogspot.com/2016/04/mean-reversion-momentum-and-volatility.html)). We use [ETF](http://www.investopedia.com/terms/e/etf.asp) `SPY` index representing the \"market\" of stock. This is the ETF that encompasses around top 500 companies in America by market capitalization. We will trade under the assumption that there is some short term autocorrelation that have predictive power in the market. \n",
    "\n",
    "**Goal**\n",
    "\n",
    "* Whether or not the next data for the given stock/ETF will be above or below the current day.\n",
    "\n",
    "**Model features**\n",
    "\n",
    "* The previous 8 days, classified if greater than the current day,\n",
    "\n",
    "* The volume changes as a percentage,\n",
    "\n",
    "* The percentage change from the previous day.\n",
    "\n",
    "Note, we are not feeding the neural network the price itself. Financial timeseries data are noisy. It is important not to overfit the data. There is a lot we can do here (smoothing, adding more features, etc.), but we will keep this tutorial simple, and demonstrate CNTK's ability to interface with timeseries data. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>diff</th>\n",
       "      <th>v_diff</th>\n",
       "      <th>p_1</th>\n",
       "      <th>p_2</th>\n",
       "      <th>p_3</th>\n",
       "      <th>p_4</th>\n",
       "      <th>p_5</th>\n",
       "      <th>p_6</th>\n",
       "      <th>p_7</th>\n",
       "      <th>p_8</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2001-02-05</th>\n",
       "      <td>134.80</td>\n",
       "      <td>135.94</td>\n",
       "      <td>134.75</td>\n",
       "      <td>135.79</td>\n",
       "      <td>4280900</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-02-06</th>\n",
       "      <td>135.30</td>\n",
       "      <td>136.70</td>\n",
       "      <td>135.22</td>\n",
       "      <td>135.39</td>\n",
       "      <td>7092200</td>\n",
       "      <td>0.002954</td>\n",
       "      <td>0.396393</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-02-07</th>\n",
       "      <td>134.72</td>\n",
       "      <td>135.40</td>\n",
       "      <td>133.68</td>\n",
       "      <td>134.69</td>\n",
       "      <td>5689800</td>\n",
       "      <td>0.005197</td>\n",
       "      <td>0.246476</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-02-08</th>\n",
       "      <td>134.80</td>\n",
       "      <td>135.40</td>\n",
       "      <td>133.10</td>\n",
       "      <td>133.12</td>\n",
       "      <td>5876800</td>\n",
       "      <td>0.011794</td>\n",
       "      <td>0.031820</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-02-09</th>\n",
       "      <td>133.35</td>\n",
       "      <td>133.35</td>\n",
       "      <td>131.26</td>\n",
       "      <td>131.84</td>\n",
       "      <td>9871200</td>\n",
       "      <td>0.009709</td>\n",
       "      <td>0.404652</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-02-12</th>\n",
       "      <td>131.70</td>\n",
       "      <td>133.50</td>\n",
       "      <td>131.70</td>\n",
       "      <td>133.35</td>\n",
       "      <td>5790300</td>\n",
       "      <td>0.011324</td>\n",
       "      <td>0.704782</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-02-13</th>\n",
       "      <td>133.70</td>\n",
       "      <td>134.17</td>\n",
       "      <td>132.00</td>\n",
       "      <td>132.26</td>\n",
       "      <td>6583200</td>\n",
       "      <td>0.008241</td>\n",
       "      <td>0.120443</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-02-14</th>\n",
       "      <td>132.65</td>\n",
       "      <td>132.65</td>\n",
       "      <td>130.66</td>\n",
       "      <td>132.06</td>\n",
       "      <td>8390200</td>\n",
       "      <td>0.001514</td>\n",
       "      <td>0.215370</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-02-15</th>\n",
       "      <td>132.84</td>\n",
       "      <td>133.52</td>\n",
       "      <td>131.99</td>\n",
       "      <td>133.34</td>\n",
       "      <td>5881800</td>\n",
       "      <td>0.009600</td>\n",
       "      <td>0.426468</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-02-16</th>\n",
       "      <td>131.00</td>\n",
       "      <td>131.29</td>\n",
       "      <td>129.30</td>\n",
       "      <td>130.40</td>\n",
       "      <td>6432800</td>\n",
       "      <td>0.022546</td>\n",
       "      <td>0.085655</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              Open    High     Low   Close   Volume      diff    v_diff  p_1  \\\n",
       "Date                                                                           \n",
       "2001-02-05  134.80  135.94  134.75  135.79  4280900  0.000000  0.000000    0   \n",
       "2001-02-06  135.30  136.70  135.22  135.39  7092200  0.002954  0.396393    0   \n",
       "2001-02-07  134.72  135.40  133.68  134.69  5689800  0.005197  0.246476    0   \n",
       "2001-02-08  134.80  135.40  133.10  133.12  5876800  0.011794  0.031820    0   \n",
       "2001-02-09  133.35  133.35  131.26  131.84  9871200  0.009709  0.404652    0   \n",
       "2001-02-12  131.70  133.50  131.70  133.35  5790300  0.011324  0.704782    1   \n",
       "2001-02-13  133.70  134.17  132.00  132.26  6583200  0.008241  0.120443    0   \n",
       "2001-02-14  132.65  132.65  130.66  132.06  8390200  0.001514  0.215370    0   \n",
       "2001-02-15  132.84  133.52  131.99  133.34  5881800  0.009600  0.426468    1   \n",
       "2001-02-16  131.00  131.29  129.30  130.40  6432800  0.022546  0.085655    0   \n",
       "\n",
       "            p_2  p_3  p_4  p_5  p_6  p_7  p_8  \n",
       "Date                                           \n",
       "2001-02-05    0    0    0    0    0    0    0  \n",
       "2001-02-06    0    0    0    0    0    0    0  \n",
       "2001-02-07    0    0    0    0    0    0    0  \n",
       "2001-02-08    0    0    0    0    0    0    0  \n",
       "2001-02-09    0    0    0    0    0    0    0  \n",
       "2001-02-12    1    0    0    0    0    0    0  \n",
       "2001-02-13    1    0    0    0    0    0    0  \n",
       "2001-02-14    0    1    0    0    0    0    0  \n",
       "2001-02-15    1    0    1    1    0    0    0  \n",
       "2001-02-16    0    0    0    0    0    0    0  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Feature name list\n",
    "predictor_names = []\n",
    "\n",
    "# Compute price difference as a feature\n",
    "data[\"diff\"] = np.abs((data[\"Close\"] - data[\"Close\"].shift(1)) / data[\"Close\"]).fillna(0) \n",
    "predictor_names.append(\"diff\")\n",
    "\n",
    "# Compute the volume difference as a feature\n",
    "data[\"v_diff\"] = np.abs((data[\"Volume\"] - data[\"Volume\"].shift(1)) / data[\"Volume\"]).fillna(0) \n",
    "predictor_names.append(\"v_diff\")\n",
    "\n",
    "# Compute the stock being up (1) or down (0) over different day offsets compared to current dat closing price\n",
    "num_days_back = 8\n",
    "\n",
    "for i in range(1,num_days_back+1):\n",
    "    data[\"p_\" + str(i)] = np.where(data[\"Close\"] > data[\"Close\"].shift(i), 1, 0) # i: number of look back days\n",
    "    predictor_names.append(\"p_\" + str(i))\n",
    "    \n",
    "# If you want to save the file to your local drive\n",
    "#data.to_csv(\"PATH_TO_SAVE.csv\")\n",
    "data.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**What are trying to predict**\n",
    "\n",
    "Here we are trying to predict whether or not the next days' trading will be above or below the current day. We will represent a predicted up day as a 1, else a 0 if the next day is the same or below. (Note: the market is unlikely going to close at the same price as it did the previous day). "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data[\"next_day\"] = np.where(data[\"Close\"].shift(-1) > data[\"Close\"], 1, 0)\n",
    "data[\"next_day_opposite\"] = np.where(data[\"next_day\"]==1,0,1) # The label must be one-hot encoded\n",
    "\n",
    "# Establish the start and end date of our training timeseries (picked 2000 days before the market crash)\n",
    "training_data = data[\"2001-02-05\":\"2009-01-20\"] \n",
    "\n",
    "# We define our test data as: data[\"2008-01-02\":]\n",
    "# This example allows to include data up to current date\n",
    "\n",
    "test_data= data[\"2009-01-20\":\"2016-12-29\"] \n",
    "training_features = np.asarray(training_data[predictor_names], dtype = \"float32\")\n",
    "training_labels = np.asarray(training_data[[\"next_day\",\"next_day_opposite\"]], dtype=\"float32\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Here we are actually building the neural network itself. We will use a simple feedforward neural network (represented as `NN` in the plots) with 10 inputs and 50 dimensions.\n",
    "\n",
    "**Suggested exercise** Try experimenting here with different sizes and number of hidden layers. What happens when we make this network large? Do we overfit the data? "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2000, 10)\n"
     ]
    }
   ],
   "source": [
    "print(training_features.shape)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Model Creation\n",
    "\n",
    "We will be using a simple MLP network as our model using the `layers` library found [here](https://cntk.ai/pythondocs/layerref.html)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Lets build the network\n",
    "input_dim = 2 + num_days_back\n",
    "num_output_classes = 2 #Remember we need to have 2 since we are trying to classify if the market goes up or down 1 hot encoded\n",
    "num_hidden_layers = 2\n",
    "hidden_layers_dim = 2 + num_days_back\n",
    "input_dynamic_axes = [C.Axis.default_batch_axis()]\n",
    "input = C.input_variable(input_dim, dynamic_axes=input_dynamic_axes)\n",
    "label = C.input_variable(num_output_classes, dynamic_axes=input_dynamic_axes)\n",
    "\n",
    "def create_model(input, num_output_classes):\n",
    "    h = input\n",
    "    with C.layers.default_options(init = C.glorot_uniform()):\n",
    "        for i in range(num_hidden_layers):\n",
    "            h = C.layers.Dense(hidden_layers_dim, \n",
    "                               activation = C.relu)(h)\n",
    "        r = C.layers.Dense(num_output_classes, activation=None)(h)   \n",
    "    return r\n",
    "    \n",
    "z = create_model(input, num_output_classes)\n",
    "loss = C.cross_entropy_with_softmax(z, label)\n",
    "label_error = C.classification_error(z, label)\n",
    "lr_per_minibatch = C.learning_parameter_schedule(0.125)\n",
    "trainer = C.Trainer(z, (loss, label_error), [C.sgd(z.parameters, lr=lr_per_minibatch)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#Initialize the parameters for the trainer, we will train in large minibatches in sequential order\n",
    "minibatch_size = 100\n",
    "num_minibatches = len(training_data.index) // minibatch_size\n",
    "\n",
    "#Run the trainer on and perform model training\n",
    "training_progress_output_freq = 1\n",
    "\n",
    "# Visualize the loss over minibatch\n",
    "plotdata = {\"batchsize\":[], \"loss\":[], \"error\":[]}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Training\n",
    "\n",
    "**Note**: Number of passes through the data, how we train time series data?\n",
    "\n",
    "\n",
    "This tutorial will differ from other tutorials in the sense that here we will not randomly send data to the trainer, instead each minibatch will be fed sequentially in the order of the time dimension. This is key to time series data-handling where we want to \"weigh\" the data at the end of our sample a slightly higher. You can put in multiple passes, however you will notice significant performance degradation. Try it out! Additionally, multiple passes tend to overfit the financial timeseries data. This overfitting can be mitigated using standard ML approaches such as [L1 regularization](https://en.wikipedia.org/wiki/Regularization_%28mathematics%29)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of mini batches\n",
      "20\n",
      "The shape of the training feature minibatch\n",
      "(100, 10)\n"
     ]
    }
   ],
   "source": [
    "tf = np.split(training_features,num_minibatches)\n",
    "\n",
    "print(\"Number of mini batches\")\n",
    "print(len(tf))\n",
    "\n",
    "print(\"The shape of the training feature minibatch\")\n",
    "print(tf[0].shape)\n",
    "\n",
    "tl = np.split(training_labels, num_minibatches)\n",
    "\n",
    "# It is key that we make only one pass through the data linearly in time\n",
    "num_passes = 1 \n",
    "\n",
    "# Defines a utility that prints the training progress\n",
    "def print_training_progress(trainer, mb, frequency, verbose=1):\n",
    "    training_loss = \"NA\"\n",
    "    eval_error = \"NA\"\n",
    "    if mb%frequency == 0:\n",
    "        training_loss = trainer.previous_minibatch_loss_average\n",
    "        eval_error = trainer.previous_minibatch_evaluation_average\n",
    "        if verbose: \n",
    "            print (\"Minibatch: {0}, Loss: {1:.4f}, Error: {2:.2f}%\".format(mb, training_loss, eval_error*100))\n",
    "    return mb, training_loss, eval_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Minibatch: 0, Loss: 0.7874, Error: 54.00%\n",
      "Minibatch: 1, Loss: 0.7570, Error: 51.00%\n",
      "Minibatch: 2, Loss: 0.7579, Error: 61.00%\n",
      "Minibatch: 3, Loss: 0.6916, Error: 47.00%\n",
      "Minibatch: 4, Loss: 0.7127, Error: 54.00%\n",
      "Minibatch: 5, Loss: 0.7286, Error: 59.00%\n",
      "Minibatch: 6, Loss: 0.7056, Error: 50.00%\n",
      "Minibatch: 7, Loss: 0.6975, Error: 48.00%\n",
      "Minibatch: 8, Loss: 0.7059, Error: 56.00%\n",
      "Minibatch: 9, Loss: 0.7037, Error: 54.00%\n",
      "Minibatch: 10, Loss: 0.7567, Error: 60.00%\n",
      "Minibatch: 11, Loss: 0.8480, Error: 52.00%\n",
      "Minibatch: 12, Loss: 0.6917, Error: 45.00%\n",
      "Minibatch: 13, Loss: 0.7526, Error: 58.00%\n",
      "Minibatch: 14, Loss: 0.6823, Error: 47.00%\n",
      "Minibatch: 15, Loss: 0.8856, Error: 40.00%\n",
      "Minibatch: 16, Loss: 0.8299, Error: 48.00%\n",
      "Minibatch: 17, Loss: 1.1737, Error: 51.00%\n",
      "Minibatch: 18, Loss: 0.7951, Error: 53.00%\n",
      "Minibatch: 19, Loss: 0.7809, Error: 48.00%\n"
     ]
    }
   ],
   "source": [
    "# Train our neural network\n",
    "tf = np.split(training_features,num_minibatches)\n",
    "tl = np.split(training_labels, num_minibatches)\n",
    "\n",
    "for i in range(num_minibatches*num_passes): # multiply by the \n",
    "    features = np.ascontiguousarray(tf[i%num_minibatches])\n",
    "    labels = np.ascontiguousarray(tl[i%num_minibatches])\n",
    "    \n",
    "    # Specify the mapping of input variables in the model to actual minibatch data to be trained with\n",
    "    trainer.train_minibatch({input : features, label : labels})\n",
    "    batchsize, loss, error = print_training_progress(trainer, i, training_progress_output_freq, verbose=1)\n",
    "    if not (loss == \"NA\" or error ==\"NA\"):\n",
    "        plotdata[\"batchsize\"].append(batchsize)\n",
    "        plotdata[\"loss\"].append(loss)\n",
    "        plotdata[\"error\"].append(error)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAACfCAYAAAD9Ln4CAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHoZJREFUeJzt3XmYVMW5x/HvD0TEgAqIC6IG9wVQE0UiKotXxd3oxYi7\nojFed2PilojrjcYlQb3R4BaD+y7uURZ3RQVkR1REQUFAQEBBYN77R52R7qa7p3umT2/zfp6nn5k+\nXV2n+kzPeU9VnaqSmeGcc87ValLqAjjnnCsvHhicc84l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EdTf6RSfRLsB7adLU2sjMugOHANdnSLMb8GtgJ6BvQhPMyWa2W/T6\nuZJam9klwPfRIjHHS9qBUIPoaWa7AOfmsO9EWwG3mlknYCFwZJbPXWtHwrz5XYFrgcXRjLjvAick\npGsRlelMwjw5AJcBQ82sG9AbuFFSi+i1XYAjzKxXhjI454HBlSczGw/8nFBbeJ7sC7c8Hb1nEpnn\nmn/FzBaY2VLgSaB2qvHzJI0hnHA7AFtH2xP31xt4zMzmR/tJnGcml31PM7Pa2suH0eeqy3Az+97M\n5gILgOei7eNS3v9QtP83gFaS1iFMjHixpNHACGBNVs1Q/IqZLcxh/64RW6PUBXAuiyHADYRJ1tbP\nkm5Zwu+ZAshqc9JL6kE46e9uZsskDQfWyrOMuew7Mc3KhH2sYNXFWep+E99jCc9rSP6/TTfXvoAj\nzWxq4guSuhH6b5zLymsMrhzVnmDvAa40swn1eG+qfSWtFzWpHA68BawLzI+CwnZAt4T0PyZ00A4j\nND+1gbC4ep77zrT9c2DX6Pe+GdLU5TdRmfYEFprZIuBl4Jyfdi7tXM+8XSPlgcGVIwMws5lmdlsu\nabM8rzWS0IQ0htAsNAp4CWgmaQLwv8A7CekHAeMkDTazidHrr0XNMzflue9M228EzpD0IdAmQ5q6\n8l0qaRRh1bNTou1XEz7XWEnjgauy5O3canzabeecc0m8xuCccy6JBwbnnHNJPDA455xL4oHBOedc\nEg8MzjnnknhgcM45l8QDg3POuST/DxlnSOw6JVX9AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x198d9ec7dd8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAACfCAYAAADqDO7LAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXm8XPP9/5+vxL7T2PetFFVRQn+KiFojqFJCS6SWKiV8\nq1VasdVOYym1hKZoUtSullgiiDQhCUJIZ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XICSNqdoAx2MrO5kp4F\nlilTxjR9J8vMT/TxLQsf6Ar7TdaxxHY9i/6ni+U6EPAzM5uQPCBpZ8L6kOM0io8wnFqj4cZ7G3C+\nmb3RjLqF7CVplTg1czDwIrAy8EVUFlsCOyfKz0ssDD9DmMZaDUDSqmX23dj+KcAO8fNhjZRpisOj\nTD8GZpjZTOAJ4NQFnUvbNbNtpx3iCsOpNQzAzD4ws+vTlC2x3cAIwlTUGML00ijgcWBJSW8AFwMv\nJcrfDLwu6Q4zezMefy5O81xVZt+N7b8SOEnSK8BqjZRpqt1vJI0iZKrrHfdfSPher0kaC1xQom3H\nWQQPb+44juOkwkcYjuM4TipcYTiO4zipcIXhOI7jpMIVhuM4jpMKVxiO4zhOKlxhOI7jOKlwheE4\njuOk4v8DogYmjvhoa0AAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x198da1fb3c8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.figure(1)\n",
    "plt.subplot(211)\n",
    "plt.plot(plotdata[\"batchsize\"], plotdata[\"loss\"], 'b--')\n",
    "plt.xlabel('Minibatch number')\n",
    "plt.ylabel('Loss')\n",
    "plt.title('Minibatch run vs. Training loss ')\n",
    "plt.show()\n",
    "\n",
    "plt.subplot(212)\n",
    "plt.plot(plotdata[\"batchsize\"], plotdata[\"error\"], 'r--')\n",
    "plt.xlabel('Minibatch number')\n",
    "plt.ylabel('Label Prediction Error')\n",
    "plt.title('Minibatch run vs. Label Prediction Error ')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice the trend for the label prediction error is still close to 50%. Remember that this is time variant, therefore it is expected that the system will have some noise as it trains through time. It should be noted; the model is still learning the market. Additionally, since this time series data is so noisy, having an error rate below 50% is good (many trading firms have win-rates of near 50% and have made money nearly every day [VIRTU](https://en.wikipedia.org/wiki/Virtu_Financial#Trading_activity)). However note they are high frequency trading firm and can leverage themselves up with low winrate strategies (51%). Trying to classify and trade every single day is expensive from transaction fees perspective. Therefore, one approach would be to trade when we think we are more likely to win?\n",
    "\n",
    "Let us try this idea."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Average error: 54.05%\n"
     ]
    }
   ],
   "source": [
    "# Now that we have trained the net, and we will do out of sample test to see how we did.\n",
    "# and then more importantly analyze how that set did\n",
    "\n",
    "test_features = np.ascontiguousarray(test_data[predictor_names], dtype = \"float32\")\n",
    "test_labels = np.ascontiguousarray(test_data[[\"next_day\",\"next_day_opposite\"]], dtype=\"float32\")\n",
    "\n",
    "avg_error = trainer.test_minibatch({input : test_features, label : test_labels})\n",
    "print(\"Average error: {0:2.2f}%\".format(avg_error * 100))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here we see that we have an error rate near 50%. At first glance this may appear to not have learned the network, but let us examine further and see if we have some predictive power."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "out = C.softmax(z)\n",
    "predicted_label_prob = out.eval({input:test_features})\n",
    "test_data[\"p_up\"] = pd.Series(predicted_label_prob[:,0], index = test_data.index)\n",
    "test_data[\"p_down\"] = predicted_label_prob[:,1]\n",
    "test_data['long_entries'] = np.where((test_data.p_up > 0.55), 1, 0)\n",
    "test_data['short_entries'] = np.where((test_data.p_down > 0.55) , -1, 0)\n",
    "test_data['positions'] = test_data['long_entries'].fillna(0) + test_data['short_entries'].fillna(0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Evaluation\n",
    "Here we take the output of our test set and compute the probabilities from the softmax function. Since we have probabilities we want to trade when there is a \"higher\" chance that we will be right, instead of just a >50% chance that the market will go in one direction. The goal is to find a signal, instead of trying to classify the market. Since the market is so noisy we want to only trade when we have an \"edge\" on the market. Moreover, trading frequently has higher fees (you have to pay each time you trade).\n",
    "\n",
    "We will say that if the prediction probability is greater than 55% (in either direction) we will take a position in the market. If it shows that the market will be up the next day with greater than 55% probability, we will take a 1-day long. If it is greater than a 55% chance that the next day will be below today's position we will take 1-day [short] (http://www.investopedia.com/university/shortselling/shortselling1.asp)(the same as borrowing a stock and buying it back). \n",
    "\n",
    "We will then evaluate this timeseries performance by looking at some more metrics: average monthly return, standard deviation of monthly returns, the [Sharpe ratio](http://www.investopedia.com/terms/s/sharperatio.asp), and the [Maximum drawdown](https://en.wikipedia.org/wiki/Drawdown_%28economics%29). The Sharpe ratio is the average return minus the risk free rate (which is basically zero) over the standard deviation of returns normalized to a year. \n",
    "\n",
    "$$Sharpe = \\frac{r_p - r_f}{\\sigma_p}$$\n",
    "$$r_p = \\text{portfolio return}$$\n",
    "$$r_f = \\text{risk free rate}$$\n",
    "$$\\sigma_p = \\text{standard deviation of portfolio return}$$\n",
    "\n",
    "Generally, the higher the Sharpe ratio, the better you are taking less risk for each unit of reward. This assumes the mean return and standard deviation are sufficient to describe the distribution of returns, akin to an assumption of normally distributed returns.\n",
    "\n",
    "A trading strategy can be profitable even if the winrate is 50% or lower, if the wins are greater than the losses you can have a less than 50% winrate and still make some money (usually classified as momentum strategies). Finally, even if we do not beat the market by trading it individually, we can still outperform it by trading multiple assets that are uncorrelated with each other (or trade a basket of stocks to get market exposure; we are not trading each at the same time). However, that will not be covered in this tutorial. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def create_drawdowns(equity_curve):\n",
    "    \"\"\"\n",
    "    Calculate the largest peak-to-trough drawdown of the PnL curve\n",
    "    as well as the duration of the drawdown. Requires that the \n",
    "    pnl_returns is a pandas Series.\n",
    "\n",
    "    Parameters:\n",
    "    pnl - A pandas Series representing period percentage returns.\n",
    "\n",
    "    Returns:\n",
    "    drawdown, duration - Highest peak-to-trough drawdown and duration.\n",
    "    \"\"\"\n",
    "\n",
    "    # Calculate the cumulative returns curve \n",
    "    # and set up the High Water Mark\n",
    "    # Then create the drawdown and duration series\n",
    "    hwm = [0]\n",
    "    eq_idx = equity_curve.index\n",
    "    drawdown = pd.Series(index = eq_idx)\n",
    "    duration = pd.Series(index = eq_idx)\n",
    "\n",
    "    # Loop over the index range\n",
    "    for t in range(1, len(eq_idx)):\n",
    "        cur_hwm = max(hwm[t-1], equity_curve[t])\n",
    "        hwm.append(cur_hwm)\n",
    "        drawdown[t]= (hwm[t] - equity_curve[t]) \n",
    "        duration[t]= 0 if drawdown[t] == 0 else duration[t-1] + 1\n",
    "    return drawdown.max(), duration.max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEZCAYAAABmTgnDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XucXXV57/HPN1yUAEm4lOBwmQkXQ+AokQKWiiQQQCgV\nqG0Bo0giHqvES6tWEkcN9hADVMWqsafxAAlKRJCqYCl3hksLhEhGLgnTEM0mZMwIRAIxCRDynD/W\nmlk7w+zLTPY1+b5fr3ll/dZtP/vJ7P3M+v3WRRGBmZlZMcPqHYCZmTU+FwszMyvJxcLMzEpysTAz\ns5JcLMzMrCQXCzMzK8nFwgZN0r9Kaq/Qvg6Q9LIkpe17JX20EvtO93erpPMrtb9BvO6lkp6X1F2D\n1/qtpJOGuG3BfBf7v5E0WdJtRfZ7vKSlQ4nJGpOLhW1B0gpJ6yWtlbRG0oOS/q73CwMgIj4ZEbPK\n2FfJL7GIWBkRI6ICF/xIminp2n77/4uI+OHW7nuQcRwAfA44LCJaBlg+QdIb6RfxWklLJU2pZYzl\nKPZ/ExELIuK03rakzZIOylv+YESMq1WsVn0uFtZfAGdExEigFbgMuBi4qtIvJGmHSu+zQbQCL0TE\ni0XWWZV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VX84EPfACAr33ta5x77rlccMEFjBgxgne8\n4x089thjlX7rJblYNDn3TWeci4xzMXSDeazqbbfdxre+9S3uvvtuli1bxl133bXF8k996lO88sor\nrFixgo6ODq699lquueYaACZMmND3/3T//fdz8MEHc//99wNw3333MWHChL793HLLLUyePJm1a9fy\n/ve/n2nTan+atIuFmVmewTxW9cYbb2Tq1KmMGzeOXXbZhUsuuaSvG2rz5s385Cc/4bLLLmP48OG0\ntrby+c9/nh/+8IdAUizuu+8+AB544AFmzJjR1+5fLI4//nje9773IYnzzz+fxx9/vFpvvyAXiybX\nbH3T1eRcZJyLoRvMY1W7u7u3eGxqa2s27vLCCy+wadMmDjzwwC2W9z5/e8KECTzwwAOsXr2azZs3\nc8455/Dggw+Sy+V4+eWXGT9+fN92++67b9/08OHD2bhxI5s3b966NzpILhZmZnkG81jVt73tbW9a\nv3fMYu+992annXYil8ttsbz3KXkHH3wwu+yyC9/97nc54YQT2G233dh3332ZO3cuxx9/fKXf1lZz\nsWhy7pvOOBcZ52LoBvNY1XPOOYd58+axdOlS1q9fv8VDjoYNG8Y555xDe3s769atI5fLceWVV3L+\n+ef3rTNhwgS+973v9XU5TZw4cYt2IfU448qnzppZ3bXs1VLV01tb9ip8dNDfYB6retppp/H3f//3\nnHTSSeywww5ceumlLFiwoG/5d77zHT796U9z0EEHscsuu/Dxj3+cqVOn9i2fMGEC119/PSeccEJf\n+5vf/GZfu5B6XMvhx6raNs23+2g8jXy7j0o/VrVemvJ2H2Zm1vxcLJqc+6YzzkXGuRiaSj9WdVvi\nMQszs9RANwCcMWMGM2bMqEM0jcVHFk3O59NnnIuMc2GV5mJhZmYluVg0OfdNZ5yLjHNhleYxCzOr\nqdbW1m32mQ+NIv+2I5XiYtHk3DedcS4yjZyLFStW1DsEGwJ3Q5mZWUkuFk3OfdMZ5yLjXGSci8qo\nerGQNFLSjZKWSnpK0rsl7SHpDkldkm6XNDJv/RmSlqXrn1rt+MzMrLRaHFn8C3BrRIwDjgSeBqYD\nd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nJrRmu3qp3bzYELha2PdpF0mPAQpKby12V\nzl8REY+m08cA90bEmojYDFwHnJAu2wzckE7/CHhPOv1OSfen9x6azJZdSTcApLcGX05yt9NyXQVM\nlTQMOBdYMIhtzSqiYW8kaFZF6yPiqPwZ6RDFH/utV+5zMHrHMK4BzoyIJyVdAEwYYJ3e/Q5m3OMm\nkpvB3Qss2oZvP28NzEcWtj0qVATy5y8ETpC0p6QdgA8CHemyYcDfpNMfIhn3ANgNWC1pp3R+vr9V\n4mBgDNBVJL5XgBG9jYh4Fbgd+FeSgmRWcy4Wtj0q9Fd93/yIWA1MJykQi0n+ov9lungdcGw6ED4R\n+D/p/K+QFJkHePMzI55Nl/0H8HcR8VqR+K4H/lHSrySNSeddR3KL8TtKvTmzavAtys2agKTPAyMi\nYma9Y7Htk8cszBqcpH8HDiJ5jrZZXfjIwszMSvKYhZmZleRiYWZmJblYmJlZSS4WZmZWkouFmZmV\n5GJhZmYl/X+lCz4XTNlFcgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x198da360940>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure()\n",
    "test_data[\"p_up\"].hist(bins=20, alpha=0.4)\n",
    "test_data[\"p_down\"].hist(bins=20, alpha=0.4)\n",
    "plt.title(\"Distribution of Probabilities\")\n",
    "plt.legend([\"p_up\", \"p_down\"])\n",
    "plt.ylabel(\"Frequency\")\n",
    "plt.xlabel(\"Probablity\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "TRADING STATS\n",
      "AVG Monthly Return :: -0.45%\n",
      "STD Monthly        :: 3.17%\n",
      "SHARPE             :: -0.49\n",
      "MAX DRAWDOWN       :: 48.20%, nan months\n",
      "Correlation to SPY :: -0.01\n",
      "NUMBER OF TRADES   :: 1175\n",
      "TOTAL TRADING DAYS :: 4000\n",
      "SPY MONTHLY RETURN :: 1.19%\n",
      "SPY STD RETURN     :: 3.92%\n",
      "SPY SHARPE         :: 1.05\n",
      "SPY DRAWDOWN       :: 17.25%, 11.0 months\n",
      "0.482027152898\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEZCAYAAAB4hzlwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xd4FNXXwPHvoQqC9KKggApKR4og8kqkiIWmIE1ABEXB\nAhYE/KlgB5WiYgMVEGkqiKIUAQlFmlTpVXqH0ENIyHn/uBsIySYksJvdJOfzPPuwO3Nn5sxumDNz\n7507oqoYY4wxABkCHYAxxpjgYUnBGGPMBZYUjDHGXGBJwRhjzAWWFIwxxlxgScEYY8wFlhSMMcZc\nYEkhnRGRkyJywvM6LyJnYk1rLSJ9ROSc5/NREZkvIjW8rKe4Z/nPvcyLjrXOQyIyQ0RaxCkzW0Q6\net7X9iwzJE6ZeSLSPtbnwiIyVET2eNa9RUS+E5FSiezvayKyzVN+p4iMjTUvVETCPfMOisjPnm10\nEpF1IpI5Vtl8InJARO5LYDtFROQHETns2fdFIvJQrPnFPPuYIc5yw0XkHRHpHes7CxeRKM/7kyKy\nOoFtZhGRD0Rkh4icFpGNIvJKnDKx9zFm/dUTWF8nEVkvIsdFZJ+I/C4i18Yp09ezH9XiTH/cM31A\nnOlNPNO/i/M9xPwNbhORnrHKR4vIzV5iezzWdxJ7Xwp72xdz5SwppDOqmlNVr1PV64AdwEOxpsUc\nMMd55ucHQoGfvKyqPXAUaBn74BmzGaCCZx23ASOBISLyRiKhnQbaichN3maKSF5gAZANuNuz7srA\nHKB+Ass8DjwG1PGUrwrMihNnV8+8UkAeYKCqfgvsBvrEKjsY+F1V//SynTzAfOAsUBr3vQ0GxojI\nI3G2542q6gcxvwPwDLDA85vkVNXyCSz3M3AvcD+QE2gHdBaRT7ztY6zfebGXfagNvAe0VNV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N9DZptP8tYHrDY+4m\njSF8ASxuaF8LfE76oyg+gHeIWbcBu0n9x98BZ+b2PmALaUbYgRrnfJA0hrM/t99bt5yk8ZiR/N6P\nPs+tNcw5g/QFZhDYDAwAU+r63jfcP4vyRx+V2qZHARvz82wBVpPPxapTztw+k9S1PQhsAHpLbtNW\nbj55zczMKnXsPjIzsw5xUTAzs4qLgpmZVVwUzMys4qJgZmYVFwUzM6u4KJhNgKQDeV6drXl65jvz\nSYcHe8wsSTdOVkazVrgomE3McERcEBFnAZcDVwAr/+Uxs4GlbU9mVoCLgtkhiojdpLnyb4Nqj+B9\nSRvzbX5e9QFgYd7DWCFpiqSHJH0iaVDSsk69BrOxfEaz2QRI2hMR08a0/QTMA/YCIxGxT9LpwPMR\ncaGkS4C7IuLqvP4yoCci7pc0FfgIuC4ivp3cV2P2d92dDmD2HzA6pjAVeEzSeaQ5cuY2WX8xcLak\n6/Pv0/K6LgrWcS4KZi2QNAfYHxE/SFoJDEXEOfl6Ds0uSCPg9ojYMGlBzcbJYwpmE9M4VXMP8AQw\nes2G44Adebkf6MrLe4FjG57jTWB5njIbSXMlHdnO0Gbj5T0Fs4k5QtImUlfR78CzEbE63/c48Iqk\nfuANYDi3bwZGJH0GrImIgXw5x035cNZdpEvGmnWcB5rNzKzi7iMzM6u4KJiZWcVFwczMKi4KZmZW\ncVEwM7OKi4KZmVVcFMzMrOKiYGZmlT8AMUa8ds3zkQMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x198dae63f98>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_data[\"pnl\"] = test_data[\"Close\"].diff().shift(-1).fillna(0)*test_data[\"positions\"]/np.where(test_data[\"Close\"]!=0,test_data[\"Close\"],1)\n",
    "test_data[\"perc\"] = (test_data[\"Close\"] - test_data[\"Close\"].shift(1)) / test_data[\"Close\"].shift(1)\n",
    "monthly = test_data.pnl.resample(\"M\").sum()\n",
    "monthly_spy = test_data[\"perc\"].resample(\"M\").sum()\n",
    "avg_return = np.mean(monthly)\n",
    "std_return = np.std(monthly)\n",
    "sharpe = np.sqrt(12) * avg_return / std_return\n",
    "drawdown = create_drawdowns(monthly.cumsum())\n",
    "spy_drawdown = create_drawdowns(monthly_spy.cumsum())\n",
    "print(\"TRADING STATS\")\n",
    "print(\"AVG Monthly Return :: \" + \"{0:.2f}\".format(round(avg_return*100,2))+ \"%\")\n",
    "print(\"STD Monthly        :: \" + \"{0:.2f}\".format(round(std_return*100,2))+ \"%\")\n",
    "print(\"SHARPE             :: \" + \"{0:.2f}\".format(round(sharpe,2)))\n",
    "print(\"MAX DRAWDOWN       :: \" + \"{0:.2f}\".format(round(drawdown[0]*100,2)) + \"%, \" + str(drawdown[1]) + \" months\" )\n",
    "print(\"Correlation to SPY :: \" + \"{0:.2f}\".format(round(np.corrcoef(test_data[\"pnl\"], test_data[\"diff\"])[0][1],2)))\n",
    "print(\"NUMBER OF TRADES   :: \" + str(np.sum(test_data.positions.abs())))\n",
    "print(\"TOTAL TRADING DAYS :: \" + str(len(data)))\n",
    "print(\"SPY MONTHLY RETURN :: \" + \"{0:.2f}\".format(round(monthly_spy.mean()*100,2)) + \"%\")\n",
    "print(\"SPY STD RETURN     :: \" + \"{0:.2f}\".format(round(monthly_spy.std()*100,2)) + \"%\")\n",
    "print(\"SPY SHARPE         :: \" + \"{0:.2f}\".format(round(monthly_spy.mean()/monthly_spy.std()*np.sqrt(12),2)))\n",
    "print(\"SPY DRAWDOWN       :: \" + \"{0:.2f}\".format(round(spy_drawdown[0]*100,2)) + \"%, \"  + str(spy_drawdown[1]) + \" months\" )\n",
    "\n",
    "print(drawdown[0])\n",
    "(monthly.cumsum()*100).plot()\n",
    "(monthly_spy.cumsum()*100).plot()\n",
    "plt.legend([\"NN\", \"SPY\"],loc=2)\n",
    "plt.ylabel(\"% Return\")\n",
    "plt.title(\"TRADING SPY OUT OF SAMPLE\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This plot shows the % returns when we trade using SPY and NN based models only when we are > 55% sure of the predicted directionality.\n",
    "\n",
    "It is interesting to see here how the NN performs during the [financial crisis](https://en.wikipedia.org/wiki/Financial_crisis_of_2007%E2%80%932008). This strategy makes money when many are losing ( refer to the dip in the green line in the plot between 2008-2010)! More importantly, this strategy has a significantly lower volatility (lower standard deviation in the blue line relative to the green line). \n",
    "\n",
    "In the summary statistic, you can also see a lower maximum drawdown of 13.62% for the NN model compared to the 55.37% for the SPY index over the same period of time. Similarly, a higher Sharpe ratio close to 1 from the NN model compared to 0.6 from the SPY index for the same period indicates the NN based decisions to be more stable (less risky). Thus, from a quant perspective it is more likely to be profitable (it makes money in many different market time periods). More importantly, the NN strategy is relatively uncorrelated with the SPY index (only 0.06 close to 0). \n",
    "\n",
    "**Suggested task**: Try to experiment with this network with different stocks and see what happens to the Sharpe ratio when you have multiple trading streams that are uncorrelated with each other. \n",
    "\n",
    "Remember when trading you can trade with leverage, and increase your return profile (as long as you are willing to handle the down times). The best trading strategies are the ones that can consistently make money no matter which market they are trading and no matter what is happening in the market. This \"edge\" is termed alpha in the quant industry.\n",
    "\n",
    "It is important to notice how much of a drawdown you will experience when trading (http://www.investopedia.com/terms/m/maximum-drawdown-mdd.asp?lgl=no-infinite). Since our current model is calculating only the percentage returns where returns are not reinvested, and we are not holding but trading, the larger the drawdown the harder it is to recover (if you lost 90% of your portfolio then have a 90% gain, you will only be at 19% of your starting value). \n",
    "\n",
    "Note, we should be tracking PNL on adjusted close prices(but not training), since the adjusted close prices incorporate data from the future (such as stock splits and dividends) which can incorporate bias into our network. Since Google Finance does not give adjusted prices, this is not a problem. However, PNL should be taken carefully due to splits and dividends."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "TRADING STATS\n",
      "AVG Monthly Return :: -0.75%\n",
      "STD Monthly        :: 5.42%\n",
      "SHARPE             :: -0.48\n",
      "MAX DRAWDOWN       :: 83.81%, 94.0 months\n",
      "Correlation to SPY :: 0.04\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEZCAYAAABmTgnDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8VPP/wPHXuz2070rLt0VaaEOIitKCImkRoexfX1tE\nfihEhUhCWqQibb5R0b73baNV0r7ve922u75/f3ymmu6du8/cmem+n4/HPNw553POeZ+ZnPecz3ZE\nVTHGGGOSkiXYARhjjAl9liyMMcYky5KFMcaYZFmyMMYYkyxLFsYYY5JlycIYY0yyLFkYY4xJliUL\nc4GIRIjISc8rVkTOeC1rLyLdRSTK8/6oiCwUkbo+9lPWs/1XPtbFee3zkIjMEJE28crMEZFOnr/r\ne7YZEK/MAhHp6PW+uIgMEpE9nn1vFpHvRKRSEuf7lohs9ZTfKSI/ea2bKyJnPesOish4zzE6i8g6\nEcnuVbaQiBwQkbsTOU5JEflBRA57zn2JiNzjtb6M5xyzxNtumIh8ICLdvD6zsyIS4/k7QkT+SuSY\nOUSkl4jsEJHTIrJBRF6LV8b7HM/v/+ZE9tdZRP4RkRMisk9EJovIlfHK9PCcx43xlj/mWd433vKW\nnuXfxfsczv8b3Coib3iVjxORf/mI7TGvz8T7XIr7OheTNpYszAWqmkdV86pqXmAHcI/XsvMX0tGe\n9YWBucA4H7vqCBwF2npfVM8fBrjes49rgeHAABF5J4nQTgOPikhpXytFpCCwCMgN3ObZdy1gHtA4\nkW0eAzoAd3rK1wFmxYvzec+6SkAB4DNVHQrsBrp7le0HTFbV6T6OUwBYCJwDrsN9bv2AUSLSKt7x\nfFFV7XX+ewCeBRZ5vpM8qlo9ke3GAw2BpkAe4FHgaRH5wtc5en3PS32cQ33gQ6CtqubznMcYH8d8\nFDiC+/7j2wK0iZcQOwIb4p8vkM9zrg8D73ol4aRGEJ//TLzPZX8S5U0qWbIw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vwIU7iPki8qfnVddTtBdQz3NH8pKIZBGRj0VkqYisEpGngnUOxsRnI7iN8QMROamqeeMt\nOwpcC0QAcaoaJSIVgJ9U9UYRqQ90UdUWnvJPAUVU9SMRyQH8D2itqjsy9myMSShbsAMw5jJ2vs0i\nBzBARGrg5g+qmEj5u4HqIvKQ531eT1lLFiboLFkYEwAi8i8gRlUPiUh3YL+qXu95lkZiDwoS4D+q\nOiPDAjUmhazNwhj/8J4SuwjwDXD+eRn5gH2evzsCWT1/RwB5vPYxDXjeMy05IlJRRHIHMmhjUsru\nLIzxj1wisgJX5RQNjFDVzz3rvgZ+FpGOwFTgtGf5GiBORFYC36vqF55Hcq7wdLs9iHvsrzFBZw3c\nxhhjkmXVUMYYY5JlycIYY0yyLFkYY4xJliULY4wxybJkYYwxJlmWLIwxxiTLkoUxxphkWbIwxhiT\nrP8H8fiy36QT6RQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x198daef3c18>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_data[\"p_up\"] = pd.Series(predicted_label_prob[:,0], index = test_data.index)\n",
    "test_data[\"p_down\"] = predicted_label_prob[:,1]\n",
    "test_data['long_entries'] = np.where((test_data.p_up > 0.50) , 1, 0)\n",
    "test_data['short_entries'] = np.where((test_data.p_down > 0.50) , -1, 0)\n",
    "test_data['positions'] = test_data['long_entries'].fillna(0) + test_data['short_entries'].fillna(0)\n",
    "test_data[\"pnl\"] = test_data[\"Close\"].diff().shift(-1).fillna(0)*test_data[\"positions\"]/np.where(test_data[\"Close\"]!=0,test_data[\"Close\"],1)\n",
    "monthly = test_data.pnl.resample(\"M\").sum()\n",
    "avg_return = np.mean(monthly)\n",
    "std_return = np.std(monthly)\n",
    "sharpe = np.sqrt(12) * avg_return / std_return\n",
    "drawdown = create_drawdowns(monthly.cumsum())\n",
    "\n",
    "print(\"TRADING STATS\")\n",
    "print(\"AVG Monthly Return :: \" + \"{0:.2f}\".format(round(avg_return*100,2))+ \"%\")\n",
    "print(\"STD Monthly        :: \" + \"{0:.2f}\".format(round(std_return*100,2))+ \"%\")\n",
    "print(\"SHARPE             :: \" +\"{0:.2f}\".format(round(sharpe,2)))\n",
    "print(\"MAX DRAWDOWN       :: \" + \"{0:.2f}\".format(round(drawdown[0]*100,2)) + \"%, \" + str(drawdown[1]) + \" months\" )\n",
    "print(\"Correlation to SPY :: \" + \"{0:.2f}\".format(round(np.corrcoef(test_data[\"pnl\"], test_data[\"diff\"])[0][1],2)))\n",
    "(monthly.cumsum()*100).plot()\n",
    "(monthly_spy.cumsum()*100).plot()\n",
    "plt.legend([\"NN\", \"SPY\"],loc=2)\n",
    "plt.ylabel(\"% Return\")\n",
    "plt.title(\"TRADING SPY OUT OF SAMPLE\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "The plot above shows the % returns when we trade every day using SPY and NN based models as compared to a confidence based trading show in previous plot. With frequent trading the volatility is higher and transaction fees (not accounted in this plot) will greatly eat into any profits.\n",
    "\n",
    "**Suggested exercises**\n",
    "Try changing the batch size, the network itself, the activation functions, and many other features and see how much it affects the output. Notice how it can change dramatically? This means what you have been training on might be noise and you need to refine either the model or more likely the inputs to the network itself. \n",
    "\n",
    "After you have completed the aforementioned exercise, experiment with applying the trained network to other timeseries data. Pick a stock in the S&P 500, pick something that is uncorrelated with the S&P 500, try a completely random dataset. How do you expect each of those to do? Should the performance match up with S&P 500 out of sample performance? How about the random data?\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.48\n"
     ]
    }
   ],
   "source": [
    "# Repeatable factor (used for runtime verification)\n",
    "print(error)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Appendix\n",
    "A great resource for getting started as a Quant: https://www.quantstart.com/\n",
    "An online back-testing and open source trading platform, hosts quant competitions and a forum: https://www.quantopian.com/\n",
    "[A summary of backtesting and biases](https://www.quantstart.com/articles/successful-backtesting-of-algorithmic-trading-strategies-part-i)\n",
    "[For those who want to automatically trade in python](https://github.com/blampe/IbPy)"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
